<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="menu.xsl" />
<xsl:include href="footer.xsl" />
<xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" method="xml" encoding="iso-8859-1" />
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
  <head>
  <title>Manager Framework users</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8" />

	<link rel="stylesheet" href="public/manager/css/manager.css" type="text/css" media="screen" />
  <script type="text/javascript" src="public/manager/js/menu.js"></script>  

  </head>
  <body>
  
  
    <div id="header">
    	<img id="logo" src="public/manager/images/bando.png" alt="inovia" />  
    </div>
    
    <!--<ul id="menu">
    	<li><a href="index.php?action=homeManager">Home</a></li>
    	<li><a class="active" href="index.php?action=homeUsers">Users</a></li>
    	<li><a href="index.php?action=homeMonitoring">Monitoring</a></li>
    	<li><a href="index.php?action=homeScaffolding">Scaffolding</a></li>
    	<li><a  href="index.php?action=homeUpdates">Updates</a></li>
    </ul>-->
    <xsl:call-template name="displayMenu">
      <xsl:with-param name="selectedMenu" select="string('users')"/>
    </xsl:call-template>
    
    
    <div id="PageLeft">
    
      <!--<div id="menutaches">
        <h2>Actions</h2>
        <ul style="margin-left:-15px">
          <a href="index.php?action=addUser"><img src="public/manager/images/stock_new.png" alt="new user" title="new user"/></a>Add an user<br/>
          <a href="index.php?action=addGroup"><img src="public/manager/images/stock_new.png" alt="new group" title="new group"/></a>Add a group<br/>
          <a href="index.php?action=deleteGroup"><img src="public/manager/images/stock_delete.png" alt="delete a group" title="delete a group"/></a>Delete a group<br/>
        </ul>
      </div>-->
    
    
      <div id="content">
        <h1 id="pageName" style="width:500px;"> Edit User </h1>
        <xsl:variable name="nbError" select="count(//error)" />
    		<xsl:if test="$nbError!=0">
    		  <p>
    		  <xsl:for-each select=".//error">
        		<span style="color:red"><xsl:value-of select="text" /></span><br/>
          </xsl:for-each>  
          </p>
    		 </xsl:if>
    		 <div style="margin:10px 0 0 20px;width:470px;padding:5px;border:1px dotted #AAAAAA;background-color:#ECF3E1;"> 
            <form action="index.php" method="post">
              <input type="hidden" name="action" value="editUser" />
              <input type="hidden" name="step" value="1" />
              <xsl:if test="site/user">
                <xsl:variable name="uid" select="site/user/uid/text()" />
                <xsl:variable name="uuser" select="site/user/uuser/text()" />
                <xsl:variable name="ugroup" select="site/user/ugroup/text()" />
                <xsl:variable name="uemail" select="site/user/uemail/text()" />

                <input type="hidden" name="id" value="{$uid}" />
                <table>
                  <tr>
                    <td>Username :</td>
                    <td><input type="text" name="username" value="{$uuser}" /></td>
                  </tr>
                  <tr>
                    <td>(Optional) Password :</td>
                    <td><input type="password" name="mdp" value="" /></td>
                  </tr>
                  <tr>
                    <td>(Optional) Password (confirmation) :</td>
                    <td><input type="password" name="mdp2" value="" /></td>
                  </tr>
                  <tr>
                    <td>Email :</td>
                    <td><input type="text" name="email" value="{$uemail}" /></td>
                  </tr>
                  <tr>
                    <td>Group :</td>
                    <td>
                    <select name="group">
                      <option value="{$ugroup}"><xsl:value-of select="site/user/ugroup/text()" /></option>
                      <xsl:for-each select="site/groups/group">
                      <xsl:variable name="gr" select="./text()" />
                        <xsl:if test="$gr!=$ugroup">
                          <option value="{$gr}"><xsl:value-of select="./text()" /></option>
                        </xsl:if>
                      </xsl:for-each>
                    </select>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="2"><input type="submit" value="Save changes"/></td>
                  </tr>
                </table>
              </xsl:if>
            </form>
        </div>
      </div>
    </div>
    
   <xsl:call-template name="displayFooter" />
  </body>
</html>
</xsl:template>
 </xsl:stylesheet>

